package com.timeDeal.servlet;





import com.timeDeal.bean.JingbiaoBean;
import com.timeDeal.bean.JubaoBean;
import com.timeDeal.bean.UserBean;
import com.timeDeal.service.JIngbiaoServicce;
import com.timeDeal.service.JubaoService;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Date;


/**
 * Created by Administrator on 2016/7/24.
 */

public class TijiaoJubaoServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, IOException {
        System.out.println("22222222222222222222222");
        String jubaoyuanyin = request.getParameter("jubaoyuanyin");
        String jubaoxiangqing = request.getParameter("jubaoxiangqing");
        System.out.println(jubaoxiangqing);
        System.out.println(jubaoyuanyin);
        String id = request.getParameter("id");
        int  jubaorenid = ((UserBean)request.getSession().getAttribute("USER")).getYonghuid() ;
        JubaoBean jb = new JubaoBean() ;
        jb.setJubaoduixiangid(Integer.valueOf(id));
        jb.setJubaorenid(jubaorenid);
        jb.setJubaoyuanyin(jubaoyuanyin);
        java.util.Date dd = new java.util.Date();
        jb.setJubaoriqi( new Date(dd.getTime()));
        jb.setShifouchuli("否");
        JubaoService js =new JubaoService();
        js.addAjubao(jb);
        request.getRequestDispatcher("/user/zhujiemiangg.jsp").forward(request, response);

    }
}